package icu.lookyousmileface.database;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

/**
 * @author starrysky
 * @title: SqlProxy
 * @projectName spring5
 * @description: TODO
 * @date 2021/2/222:52
 */
public class SqlProxy implements SqlUse{

    @Autowired
    private SqlUse sqlUse;

    public SqlProxy(SqlUse sqlUse) {
        this.sqlUse = sqlUse;
    }

    @Override
    public void add() {
        logs();
        sqlUse.add();
    }

    @Override
    public void delete() {
        logs();
        sqlUse.delete();
    }

    @Override
    public void update() {
        logs();
        sqlUse.update();
    }

    @Override
    public void query() {
        logs();
        sqlUse.query();
    }

    public void logs(){
        System.out.println("[DEBUG-------->]"+new Date());
    }
}
